package pers.karl.design.structure.flyweight;

/**
 * 棋子
 */
public class Chessman implements ChessmanAction {

    /**
     * 形状
     */
    private String shape;

    /**
     * 颜色
     */
    private String color;

    /**
     * 尺寸/大小
     */
    private int size;

    public Chessman(String shape, String color, int size) {
        this.shape = shape;
        this.color = color;
        this.size = size;
    }

    public String getShape() {
        return shape;
    }

    public String getColor() {
        return color;
    }

    public int getSize() {
        return size;
    }

    @Override
    public String toString() {
        return "Chessman{" +
                "shape='" + shape + '\'' +
                ", color='" + color + '\'' +
                ", size=" + size +
                '}';
    }

    @Override
    public void show(int posX, int posY) {
        System.out.println(
            this.toString() + ", position：" + posX + "," + posY
        );
    }

}
